package com.junjun.ssm;

import com.junjun.ssm.dao.IUserDao;
import com.junjun.ssm.entity.UserEntity;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootTest(classes = com.junjun.ssm.RedisApp.class)
@Slf4j
public class RedisText {

    @Autowired
    RedisTemplate<String, Object> redisTemplate;

    @Autowired
    IUserDao userDao;
    @Test
    public void text1() {
        String key = "user";
        redisTemplate.delete(key);

    }
    @Test
    public void  text2(){
        for (int i = 1; i <= 50; i++) {
            userDao.save(new UserEntity(i,"user"+i,20+i,80+i,"123456"));
        }
    }





}
